package com.wuyou.single.common.exception;

import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import sun.misc.MessageUtils;

/**
 * @Description
 * @Author 无忧
 * @Date 2024/6/11 22:34
 */
public class BaseException extends RuntimeException{

    private String serverName;

    private String module;

    private Integer code;

    private String params;

    private String message;

    private String detailMsg;

    private String optUser;


//    @Override
//    public String getMessage()
//    {
//        String message = null;
//        if (!ObjUtil.isEmpty(code))
//        {
////            message = MessageUtils.message(code, args);
//        }
//        if (message == null)
//        {
//            message = getMessage();
//        }
//        return message;
//    }


    public BaseException(String message, String serverName, int code, String params, String detailMsg, String optUser) {
        super(message);
        this.serverName = serverName;
//        this.module = module;
        this.code = code;
        this.params = params;
        this.message = message;
        this.detailMsg = detailMsg;
        this.optUser = optUser;
    }

    public String getServerName() {
        return serverName;
    }

    public void setServerName(String serverName) {
        this.serverName = serverName;
    }

    public String getModule() {
        return module;
    }

    public void setModule(String module) {
        this.module = module;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getParams() {
        return params;
    }

    public void setParams(String params) {
        this.params = params;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getDetailMsg() {
        return detailMsg;
    }

    public void setDetailMsg(String detailMsg) {
        this.detailMsg = detailMsg;
    }

    public String getOptUser() {
        return optUser;
    }

    public void setOptUser(String optUser) {
        this.optUser = optUser;
    }
}
